# -*- coding: utf-8 -*-
import os
import subprocess

# files = os.popen("cmd")
# todo：方式1
# os.system('ipconfig')
# todo:方式2
# p = os.popen('ipconfig')
# print("p.read(): {}\n".format(p.read()))

# todo：方式3


# p = subprocess.Popen('ls -l', shell=True)
p1 = subprocess.Popen('npm run start', shell=True,cwd=r'E:\devcode\kzsny\wmp\wmp-uca-web-main')
p2= subprocess.Popen('npm run start', shell=True,cwd=r'E:\devcode\kzsny\wmp\wmp-uca-web-ssoLogin')
p3 = subprocess.Popen('npm run start', shell=True,cwd=r'E:\devcode\kzsny\wmp\wmp-uca-web-usm')
p4= subprocess.Popen('npm run start', shell=True,cwd=r'E:\devcode\kzsny\wmp\wmp-uca-web-login')

p5 = subprocess.Popen('npm run start', shell=True,cwd=r'E:\devcode\kzsny\wmp\NewEnergy-web')
p6= subprocess.Popen('npm run start', shell=True,cwd=r'E:\devcode\kzsny\wmp\NewEnergy-web-business')
p7 = subprocess.Popen('npm run start', shell=True,cwd=r'E:\devcode\kzsny\wmp\NewEnergy-web-usm')

# p.returncode
# p.wait()  # 0
# p.pid  # 子进程的 PID
# p.returncode  # 子进程的返回状态.
# #  None —— 子进程尚未结束；
# #  ==0 —— 子进程正常退出；
# #  > 0—— 子进程异常退出，returncode对应于出错码；
# #  < 0—— 子进程被信号杀掉了.
# p.stdin
# p.stdout
# p.stderr